package com.ljd.music.service.impl;

import com.ljd.music.dao.SongListMapper;
import com.ljd.music.dao.SongMapper;
import com.ljd.music.pojo.SongList;
import com.ljd.music.service.SongListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SongListServiceImpl implements SongListService {

    @Autowired
    private SongListMapper songListMapper;

    @Override
    public boolean insert(SongList songList) {
        return songListMapper.insert(songList) > 0;
    }

    @Override
    public boolean update(SongList songList) {
        return songListMapper.update(songList) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return songListMapper.delete(id) > 0;
    }

    @Override
    public boolean deleteSongLists(List<String> singerIds) {
        return songListMapper.deleteSongLists(singerIds) > 0;
    }

    @Override
    public SongList selectByPrimaryKey(Integer id) {
        return songListMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<SongList> allSongList() {
        return songListMapper.allSongList();
    }

    @Override
    public List<SongList> selectSongListOfName(String name) {
        return songListMapper.selectSongListOfName("%" + name + "%");
    }
}
